package org.geeks.controller;

import java.util.Arrays;

import javax.servlet.http.HttpSession;

import org.geeks.domain.User;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

/**
 * Showcase Controller
 * 
 * @author Geek4J
 *
 */
@Controller
public class ShowcaseController {

	/**
	 * Forward to Thymeleaf
	 * 
	 * @return String viewName
	 */
	@GetMapping("")
	public String hello(Model model, HttpSession session) {
		User user = new User().setUsername("Geek-S");
		model.addAttribute("user", user);
		model.addAttribute("options", Arrays.asList("Option-0", "Option-1", "Option-2", "Option-3"));
		session.setAttribute("username", "oo");
		return "hello";
	}
}
